package datasource.zhuocan.cn.c3p0;

import com.mchange.v2.c3p0.ComboPooledDataSource;

import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.SQLException;

/**
 * 版权：卓灿教育集团 版权所有
 * author :赵航
 *
 * @e-mail: zhaohangcn@gmail.com
 * time：2021/2/17
 * describe ：
 */
public class C3p0Dome2 {
    public static void main(String[] args) throws SQLException {
        DataSource dataSource = new ComboPooledDataSource();

        for (int i = 1; i <=11; i++) {
            Connection connection = dataSource.getConnection();
            System.out.println("当前的连接是"+i+"====="+connection);
            if (i==5){
                connection.close();
            }
        }

    }
}
